import { CoolController, BaseController } from '@cool-midway/core';
import { Body, Inject, Post, Get, Query } from '@midwayjs/core';
import { FlockInfoEntity } from '../../entity/info'; 
import { FlockInfoService } from '../../service/info'; 
import { FlockInfoTypeService } from '../../service/infoType'; 


/**
 * flock模块-群信息
 */
@CoolController({
  prefix: "/apid/flock",
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: FlockInfoEntity,
  service: FlockInfoService,
  pageQueryOp: {
    keyWordLikeFields: ['name'],
    fieldEq: ['views', 'favorites', 'likes', 'price', 'nextDayPrice'],
  }
})
export class AdminFlockInfoController extends BaseController {
    @Inject()
    flockInfoService: FlockInfoService;

    @Inject()
    flockInfoTypeService:FlockInfoTypeService

    @Get('/getFlockDetail')
    async getFlockDetail(@Query() queryData: any) {
      return this.ok(await this.flockInfoTypeService.getFlockDetail(queryData));
    }
    
}
